Skip to content

Agentic UI: Strip local domain suffix from publish flow domain suggestion - #4743

Merged
bcotrim merged 3 commits into
trunkfrom
stu-2393-strip-local-domain-in-publish-flow
Sep 3, 2026
Merged

Agentic UI: Strip local domain suffix from publish flow domain suggestion#4743
bcotrim merged 3 commits into
trunkfrom
stu-2393-strip-local-domain-in-publish-flow

Conversation

@bcotrim

@bcotrim bcotrim commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Written with Claude Code (analysis, implementation, tests); reviewed by me.

Proposed Changes

Following "Create a new WordPress site" from the publish/sync flow prefilled the WordPress.com domain search with the site's local domain (e.g. mysite.wp.local), so the first screen in the handoff showed an "invalid domain" warning instead of suggestions.

  • A shared stripLocalDomainSuffix helper in packages/common now derives the suggestion: the exact .wp.local suffix (Studio's default) is stripped entirely; otherwise only a single trailing .local label is removed, so mysite.com.local suggests mysite.com.
  • Both front ends use it — the agentic UI (which did no stripping) and the classic UI (which only handled exact .wp.local).

Testing Instructions

  1. Create a Studio site with the default custom domain (<site-name>.wp.local).
  2. In the agentic UI, start the publish flow and follow "Create a new WordPress site" — the domain search should be prefilled with the bare site name and show real suggestions, no warning.
  3. Repeat from the classic UI sync flow.
  4. Edge cases: a site with custom domain mysite.local prefills mysite; mysite.com.local prefills mysite.com.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Aug 31, 2026
@bcotrim
bcotrim requested a review from a team August 31, 2026 10:27
@bcotrim bcotrim changed the title Strip local domain suffix from publish flow domain suggestion Agentic UI: Strip local domain suffix from publish flow domain suggestion Aug 31, 2026
@wpmobilebot

wpmobilebot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 123e0a5 vs trunk

app-size

Metric trunk 123e0a5 Diff Change
App Size (Mac) 1425.96 MB 1425.96 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 123e0a5 Diff Change
load 1220 ms 1293 ms +73 ms 🔴 6.0%

site-startup

Metric trunk 123e0a5 Diff Change
siteCreation 7525 ms 7524 ms 1 ms ⚪ 0.0%
siteStartup 3366 ms 3374 ms +8 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim
bcotrim requested a review from wojtekn September 2, 2026 07:58

@wojtekn wojtekn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the fix.

Comment thread packages/common/lib/domains.ts Outdated
if ( domain.endsWith( DEFAULT_CUSTOM_DOMAIN_SUFFIX ) ) {
return domain.slice( 0, -DEFAULT_CUSTOM_DOMAIN_SUFFIX.length );
}
if ( domain.endsWith( '.local' ) ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be constant, too, but it's a minor nit.

@bcotrim
bcotrim merged commit 92d7ad5 into trunk Sep 3, 2026
13 checks passed
@bcotrim
bcotrim deleted the stu-2393-strip-local-domain-in-publish-flow branch September 3, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants